VCF2AVS by -H
=============

NOTE:
=====
In order to use VCF2AVS with
full functionality you have to 
download several tools:

Virtual Dub:
http://www.virtualdub.org

BeSweet:
http://DSPguru.doom9.net/

AVISplitCalc:
http://ia.microdee.net/

BeSweet and VirtualDub are used to
process Audio from AVI/AVS-Files.
AVISplitCalc is used for batch splitting
AVI-files.

You can place AVISplit and VirtualDub in 
any directory you wish as long as you 
edit the related settings in "VCF2AVS.INI".

BeSweet.Exe and all related DLLs have to 
be placed inside the VCF2AVS directory.

Version History:
================
V4.0 - 21.8.2004:
(Dont ask about the other versions ;)
Added lots of stuff.

Automized D2V generation and MPEG Audio
demuxing, when opening a MPEG2 source file.
Wrapping a M2V also helps if you want to feed
a movie to your favourite MPEG encoder. I often
cut the MPEG2 streams I capture with Cuttermaran
and re-encode them so that I can put two movies
on a DVD-R. VCF2AVS helps to make this easy.

Denoising switched to FluxSmooth.

Added support for DGIndex instead of DVD2AVI
CLI. MPEG2->AVS Conversion part removed as
the automized D2V generation fills this gap.

Ability to add your own BeSweet profiles like this:
MyProfilename= my Commandline
<snip>
MP3 ABR 128kBit=-core ( -input "%in" -output "%out.mp3" ) -ssrc ( --normalize ) -lame( --abr 128 )
MP3 CBR 128kBit=-core ( -input "%in" -output "%out.mp3" ) -ssrc ( --normalize ) -lame( -b 128 )
MP3 Mono 128kBit=-core ( -input "%in" -output "%out.mp3" ) -ssrc ( --normalize ) -lame( --abr 128 -m m )
MP2 Stereo 256kBit=-core ( -input "%in" -output "%out.mpa" ) -ssrc ( --normalize ) -2lame ( -m s -b 256 -e ) 
OGG Stereo 128kBit=-core ( -input "%in" -output "%out.ogg" ) -ssrc ( --normalize ) -ogg( -b 128 )
AC3 Stereo 256kBit=-core ( -input "%in" -output "%out.ac3" ) -ssrc ( --normalize ) -ac3enc ( -b 256 )
AC3 384kBit=-core ( -input "%in" -output "%out.ac3" ) -ssrc ( --normalize ) -ac3enc ( -b 384 )
etc.
<snip>
Ability to add all AVI Synth commands
to source script if you use an AVISynth
file for input.


V3.3 - 9.5.2004:
Added Batch-processing for MPEG2 files
instead of merging several MPEG2 files for
one project. This should help to process
big amounts of MPEG2 captures like the one
you get from the PVR family from Haupauge. 
Support for Nics MPEG Decoder.dll as well
as for MPEG2Dec.dll for DVD2AVI projects as
sometimes DVD2AVI projects generated from
PVR captures fail to open with MPEG2Dec.dll


V3.0 - 14.3.2004:
Added a more flexible profile handling
for the BeSweet profiles. 

V2.8 - 8.2.2004:
Removed Blur Function for Denoise
Added Temporal Smoother for Denoise
Temporal Smoother and Fading Values are
now stored to INI-File.
Fixed some minor bugs

V2.6 - 30.8.2003:
Added Blur Function from AVISynth as 
simple "Denoiser" or "Compressibility 
enhancer" (as you like to discribe it).

V2.5.1 - 15.7.2003:
Added checking width divideable by 4 for AVISynth 2.5
Removed FluxSmooth because GKnot sometimes crashs when
opening up AVS with FluxSmooth as source.

Modified MPEG2->AVS function for better compatibiliy.

V2.5 - 1.7.2003:
Removed Convolution3D and added FluxSmooth Support instead.
Switched from AVISynth 2.0 Plugins to AVISynth 2.5 because Im now
using GKnot Development instead of TheWefs Original Version.

Removed fuckin "AVI file open" check in the source file windows.
Just make shure yourself that your sources AVIs arent in use.

One personal question: Has anyone tried to open MPEG2 files captured
with a Hauppauge WinTV PVR 250/350 via my MPEG2 function ?

V1.9 - 2.2.2003
Fixed a trim bug. Now "triming" works correctly.
Thanks to "Zhnujm" and "^^-+I4004+-^^" for pointing
out.

Added Field Deinterlace based on Decomb.dll

Fixed some errors in predefined profiles for 
audio encoding.  

V1.8 - 26.1.2003
Automatic demuxing and generation of
AVS-script for MPEG2 files. Currently only MPEG-audio
is supported for direct opening via MPEG Audio import 
DLL for AVISynth. Also converting MPA to wave is supported
by my tool mpA2Wav. Im planing to support also AC3 but 
this depends on AVISynth support for AC3.

Renaming of target AVS based on VCF file is supported now.
Just open up a VCF file and press "CTRL+R" and your target
AVS is renamed as your VCF file. I made this for people that 
capture full VHS tapes to one big / or multiple AVIs and use
several VCF files for each movie.

V1.6 - 12.1.2003
Fixed error that prevented VirtualDub from
finding the script file for saving wave(s)
when VDub was stored in a path with country
specific characters.
Thanks to Sillkotscha for pointing out...

Added multiple profiles for audio encoding:
OGG, MP3, MP2 and AC3
You can edit those presets inside the
VCF2AVS ini as discribed to the BeSweetParam
below.
Ini-Values are named (guess what):
MP3, MP2, OGG and AVI
So now instead of BeSweetParam youll find
the following presets:
MP3=-core ( -input "%in" -output "%out.mp3" ) -ssrc ( --normalize ) -lame( --abr 128 )
MP2=-core ( -input "%in" -output "%out.mp2" ) -ssrc ( --normalize ) -mp2enc (-m s -b 224 )
OGG=-core ( -input "%in" -output "%out.ogg" ) -ssrc ( --normalize ) -ogg( -b 128 )
AC3=-core ( -input "%in" -output "%out.ac3" ) -ssrc ( --normalize ) -ac3enc ( -b 256 )

Feel free to edit as you like :)

Fixed some minor bugs

Added check for VCF2AVI.ini:
If no ini-files exists in your VCF2AVS directory
then youll get a warning ("No Ini-file found !!!") 
and VCF2AVS will exit.

V1.5 - 12.1.2003
Added some minor error checks to prevent
VCF2AVS from crashing at the stupid errors.

Added batch AVI splitting with the use of
AVISplitCalc. Just edit the path in the 
VCF2AVS.ini.

For me this is:
AVISplitPath=C:\winapp\avisplit\
Set your splitsize (700 MB default).
Add (multiple) AVI files to the box
and click at the "process file(s)" 
button. Now AVISplitCalc is called and
automaticly splits all files and stores
them in the directory that is configured
at AVISplitCalc. The renaming conventions
can be configured inside AVISplitCalc.
If you check the box "delete file" your
source AVI will be deleted but I dont 
suggest to use this unless you are low
at diskspace because its safer to 
check the splitted AVI first be4 
deleting the source AVI.


I also removed BeSweet from the package
because of size.

V1.4 - 10.1.2003
Hopefully fixed some bugs in the audio
encoding module that prevented VirtualDub
from saving the wave file under correct
name and therefore caused BeSweet to crash
during encoding. This should also solve
the problems that occured when long pathnames
and/or long filenames were used for AVS files.
Ive also eleminated the use of a batch file 
to call VDub and BeSweet. Now both tools are
called from VCF2AVS directly.

Added support for using a different INI-file
at commandline.
Now you can copy the VCF2AVS ini file, rename
it and use seperate settings for BeSweet.
Example: You encode audio both to MP3 and MP2.
Copy the existing VCF2AVS.ini and edit the 
BeSweet commandline like discribed below.
Save it under a new name (like MP2.ini). 
Now create two shortcuts: One without any parameter
behind the filename. VCF2AVS will open the standard
Ini-file. Create another shortcut like 
"VCF2AVS.exe C:\VCF2AVS\MP2.ini". This 
will launch VCF2AVS using the MP2 audio ini.

May be Ill implement multiple profiles 
for VCF2AVS but currently this should be 
flexible enough. 
 
----------------------------------------------

V1.3 - 5.1.2003
Added audio batch processing for AVI and AVS
files by using VirtualDub for Wave extraction
and BeSweet (with a configurable commandline)
See below how to use this.... :)

----------------------------------------------

V1.2 - 1.1.2003
Added denoise function based on Dolemites DVX
presets for Convolution3D.

Added support for reading cropping values
from VCF file and coverting those values
to AVS croppig syntax. This way you can easily
crop away damaged parts of the movie and feed 
the movie as AVS file to GKnot or any other 
encoding app.

Added fade in and out support.
You can specify the amount of frames to fade in
and out. 
Default: 50 frames 
(for PAL 50 FPS means 2 seconds)

Added crossfade (X-fade) feature for multiple
cutpoints. This is a great feature for commercials.
VCF2AVS adds a fade out to the end of one part and
a fade in to the beginning of the next part.
You can specify the amount of frames to fade in
and out. 
Default: 25 frames 
(for PAL 25 FPS means 1 seconds)
Note: The value is applied to both fade in 
and out. So 25 frames means a 50 frames crossfade :)

----------------------------------------------

V1.1 - 20.11.2002
Fixed a small bug because I calculated the start
frame in AVISynth wrong.

Thanks to bb for pointing out :)

----------------------------------------------

How to use audio processing with VCF2AVS:
=========================================
Before you can use audio processing in VCF2AVS
you have to do two things:
1) Extract BeSweet.exe to the VCF2AVS directory
2) Enter your VirtualDub path in the VCF2AVS ini

The VCF2AVS ini-file looks like this:
[Common]
VDubPath=C:\winapp\VirtualDub\
BeSweetParam=-core ( -input "%in" -output "%out.mp3" ) -ssrc ( --normalize ) -lame( --abr 128 )

The first value points to your VirtualDub.exe file. 
Please note that the \ at the end of the path.
Dont forget it... ;)

The second value is a configurable string that is 
used when calling BeSweet. This is nothing new but
makes VCF2AVS very flexible. Why ? Ill explain:

%in is a placeholder and replaced by the AVI/AVS
source file. %out is also a placeholder but is
only replace by the sourcefile name WITHOUT extension.
This is important because BeSweet uses the target file
extension to choose the encoding mode.
*.MP3 will be encoded with LAME
*.AC3 will be encoded with AC3Enc
etc.

So for encoding your AVI/AVS files to 256 kBit AC3 you 
could use  the following line for BeSweetParam:
-core ( -input "%in" -output "%out.ac3" ) -ssrc ( --normalize ) -ac3enc ( -b 256 )
 
For MP2 audio encoding the line could look like this:
-core ( -input "%in" -output "%out.mp2" ) -ssrc ( --normalize ) -mp2enc ( -b 224 -m o s )

For OGG audio encoding like this:
-core ( -input "%in" -output "%out.ogg" ) -ssrc ( --normalize ) -ogg( -b 128 )

etc.

I hope your get the picture. Just a final word on
the BeSweet params and this is VERY IMPORTANT:

BeSweet is very sensivtive about HAVING A BLANK  
between your parameters and the brackets.
So "-lame ( --abr 128 )" will work while
"-lame (-abr 128 )" or "-lame( --abr 128)"
will mostly fail. If BeSweet doesnt use
your parameters, then look for missing blanks.

After youve configured the BeSweet param to your needings,
you can start up VCF2AVS. Now add your AVI/AVS file(s) to 
the file list. You can choose if you want to delete the
intermediate wave file after compressing to the format
of your choice. By checking the checkbox 
"Compress wave file with BeSweet" the wave files will
be compressed. Deleting wave will only work in 
combination with compressing the file with BeSweet.

If both checkboxes arent used, VCF2AVS will only 
produce wave files. Wave files and compressed files
will be stored in the same directory as the source 
AVS/AVI file(s). So make shure that you have enough
free HD space.

----------------------------------------------

What does this tool do ?
It extracts the SelectRange argument from a
VCF file (Virtual Dub Configurationfile) and
converts it to a AVISynth trim command.

So you can easily edit out the commercials
in your captured AVI(s) using Virtual Dub.

Also nulltransform aka cropping is extracted 
from VCF file if available.

How to use:
===========
1) Edit/Cut your AVI(s) in VDub
2) Crop unwanted parts of the movie away with nulltransform
3) Save the settings in a VCF file
4) Launch VCF2AVS
5) Open your AVI(s) with the browse button
6) Open your corresponding VCF file
7) Choose your settings (denoise, X-fade, etc)
8) Save the AVS script
9) Open the AVS file with your favourite encoding app.

Now use the AVS script as a base. Add
resize, deinterlace as you like.

VCF2AVS automaticly enables/disables the various checkboxes
and comboboxes. If no crop- or trim-informations are available
then you cant select the coresponding boxes.)
If the Convolution3D DLL is not found in the VCF2AVS dir then
you cant select denoising. And so on.....

So if anything is "grayed out", dont blame me ;)

To those of you who still havent understood 
what this tool does: 

It takes this part of a VCF file 
VirtualDub.subset.Clear(); 
VirtualDub.subset.AddRange(688,28923); 
VirtualDub.subset.AddRange(40720,31518); 
VirtualDub.subset.AddRange(75474,58825); 
VirtualDub.subset.AddRange(139121,60731); 

and converts it to this AVS code 
Trim(689,29611)+Trim(40721,72238)+Trim(75475,134299)+Trim(139122,199852) 

For fade in I use the reverse.fadeout2(..).reverse command. This is a
"hack" and not needed with newer versions of AVISynth because there
is a FadeIn command. Ive kept the reverse-stuff because its more 
compatible with older version of AVISynth. 
Thanks to Michael for pointing out this trick.


Of course this prog comes without warranty.
Use at own risk..etc..bla...bla..bla

Some final notes:
=================
Thanks to TheWef there is a new version of GKnot that supports AVS and AVI 
beside the (long supported) DVD2AVI projekt files. By combining Virtual Dub,
VCF2AVS and GKnot you get "the best of both worlds".
You can easily eding and crop inside Virtual Dub (the BEST Video-editing-app
Ive ever seen). After this use the power of AVISynth and the speed gain
during fast recompress mode. Also without any cropping and triming in mind
VCF2AVS adds more flexibiliy to GKnot. You can open segmented multiple AVIs
and also open BIG AVIs (like 20 GB or more).

<c> by -H in 2004
